package com.entor.springboot201912.controller;

import com.entor.springboot201912.service.StudentServiceI;
import com.entor.springboot201912.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("/rc")
@RestController
public class RedisController {
    @Autowired
    private RedisUtil rs;
    @Resource(name="studentService")
    private StudentServiceI ssi;

    @RequestMapping("/setData")
    @ResponseBody
    public boolean setData(String key,String value){
        return rs.setData(key,value);
    }

    @ResponseBody
    @RequestMapping("/getData")
    public Object getData(String key){
        return rs.getData(key);
    }

    @RequestMapping("/setList")
    @ResponseBody
    public boolean setList(String key){
        return ssi.setList(key);
    }

}
